<?php
/**
 * Created by PhpStorm.
 * User: Lin
 * Date: 2019/4/9
 * Time: 23:07
 */
namespace IMooc\Database;


use IMooc\Database;

class PDO implements Database
{
    protected $coon;
    function connect($host, $user, $passwd, $dbname)
    {
        $coon =  new \PDO("mysql:host=$host;dbname=$dbname", $user, $passwd);
        $this->coon = $coon;
    }
    function query($sql)
    {
        return $this->coon->query($sql);
    }
    function close()
    {
        unset($this->coon);
    }
}